package com.design.xiangyuan;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 活动工厂
 * @author ytj
 * @date 2024/11/28 10:27
 */
public class ActivityFactory {
    private Map<String,Activity> map=new HashMap<>();

    public Activity getActivityById(String id){
        Activity activity = map.get(id);
        if(activity==null){
            activity=new Activity();
            activity.setId("10000");
            activity.setName("享元模式测试活动");
            activity.setStartTime(new Date());
            activity.setEndTime(new Date());
        }
        return activity;
    }
}
